<script setup>
// This starter template is using Vue 3 <script setup> SFCs
// Check out https://vuejs.org/api/sfc-script-setup.html#script-setup
import { reactive } from 'vue';
import NavBarVue from './components/NavBar.vue';
let data=reactive({
      friends: [
        { id: 15, name: "Tom" },
        { id: 113, name: "Jimmy" },
        { id: 19, name: "Mike" },
        { id: 9, name: "Jessica" },
      ],
      chatData: {
        15: [
          { self: true, msg: "在不在?" },
          { self: true, msg: "在不在1?" },
          { self: true, msg: "在不在2?" },
          { self: true, msg: "在不在3?" },
          { self: true, msg: "在不在4?" },
          { self: false, msg: "没钱" }
        ],
        113: [
          { self: true, msg: "睡了吗?" },
          { self: true, msg: "睡了吗?" },
          { self: true, msg: "睡了吗?" },
          { self: true, msg: "睡了吗?" },
          { self: true, msg: "睡了吗?" },
          { self: false, msg: "奥利给!" }
        ],
        19: [
          { self: true, msg: "画画的贝贝?" },
          { self: true, msg: "画画的贝贝?" },
          { self: true, msg: "画画的贝贝?" },
          { self: true, msg: "画画的贝贝?" },
          { self: true, msg: "画画的贝贝?" },
          { self: false, msg: "一给屋里giao giao!" }
        ],
        9: [
           { self: true, msg: "在吗,妹妹?" },
          { self: true, msg: "在吗,妹妹?" },
          { self: true, msg: "在吗,妹妹?" },
          { self: true, msg: "在吗,妹妹?" },
          { self: true, msg: "在吗,妹妹?" },
          { self: false, msg: "在,v借50" }
        ]
      }
    })
let addMessage=(message)=>{
  let id=message.id;
  data.chatData[id].push(message);
};
</script>

<template>
  <NavBarVue></NavBarVue>
  <RouterView :friends="data.friends" @add-message="addMessage" :chatdata="data.chatData"></RouterView>
</template>

<style scoped>
</style>
